Skip to content

Autodetect android location#5446

Draft
ealmloff wants to merge 2 commits intoDioxusLabs:mainfrom
ealmloff:dioxus-android-detection
Draft

Autodetect android location#5446
ealmloff wants to merge 2 commits intoDioxusLabs:mainfrom
ealmloff:dioxus-android-detection

Conversation

@ealmloff
Copy link
Copy Markdown
Member

@ealmloff ealmloff commented Apr 3, 2026

Try to auto detect android install location when the environment variable isn't set. Tested with the android studio install on:

  • Windows
  • Macos
  • Linux

@ealmloff ealmloff added cli Related to the dioxus-cli program mobile Mobile renderer labels Apr 3, 2026
// Sometimes users set only the NDK (especially if they're somewhat advanced) so we need to look for it manually
//
// Might look like this, typically under "sdk":
// "/Users/jonkelley/Library/Android/sdk/ndk/25.2.9519653/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android24-clang"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woudl be nice to keep the example path

Copy link
Copy Markdown
Member

@nicoburns nicoburns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Havne't tested, but this looks sensible to me. Most users will have installed at a standard location.

Only possible concern is that upgrading or installing new versions of the SDK might be more likely to break things (with it being less obvious to the user how to fix that).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli Related to the dioxus-cli program mobile Mobile renderer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants